﻿using System;
using System.Collections.Generic;
using Terraria.ModLoader.IO;

namespace Terraria.ModLoader.Default
{
	// Token: 0x02000300 RID: 768
	public class MysteryGlobalItem : GlobalItem
	{
		// Token: 0x170001EC RID: 492
		// (get) Token: 0x06001D4F RID: 7503 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public override bool InstancePerEntity
		{
			get
			{
				return true;
			}
		}

		// Token: 0x170001ED RID: 493
		// (get) Token: 0x06001D50 RID: 7504 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public override bool CloneNewInstances
		{
			get
			{
				return true;
			}
		}

		// Token: 0x06001D51 RID: 7505 RVA: 0x00438D30 File Offset: 0x00436F30
		public override GlobalItem Clone()
		{
			MysteryGlobalItem mysteryGlobalItem = (MysteryGlobalItem)base.Clone();
			if (this.data != null)
			{
				mysteryGlobalItem.data = TagIO.Clone<IList<TagCompound>>(this.data);
			}
			return mysteryGlobalItem;
		}

		// Token: 0x06001D52 RID: 7506 RVA: 0x00014C16 File Offset: 0x00012E16
		public override bool NeedsSaving(Item item)
		{
			return this.data.Count > 0;
		}

		// Token: 0x06001D53 RID: 7507 RVA: 0x00014C26 File Offset: 0x00012E26
		public override TagCompound Save(Item item)
		{
			TagCompound tagCompound = new TagCompound();
			tagCompound["modData"] = this.data;
			return tagCompound;
		}

		// Token: 0x06001D54 RID: 7508 RVA: 0x00014C3E File Offset: 0x00012E3E
		public override void Load(Item item, TagCompound tag)
		{
			ItemIO.LoadGlobals(item, tag.GetList<TagCompound>("modData"));
		}

		// Token: 0x040018EF RID: 6383
		internal IList<TagCompound> data = new List<TagCompound>();
	}
}
